package com.icoding.movie.controller;

import com.icoding.starter.http.MyHttpClient;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RequestMapping("movie")
@RestController
public class MovieController {

    Logger logger = LoggerFactory.getLogger("MovieController");

    @Autowired
    private MyHttpClient myHttpClient;

    @GetMapping("/latest")
    public String latestMovie(){
        logger.warn("小姐姐，一起看电影吗？日本大片");
        return myHttpClient.getHtml().toString();
    }
}
